package org.WhyMCA.Models;

/**
@author Danilo '' Riso >> danilo DOT riso AT gmail DOT com
* @author Androidiani Dev Team
* @version 1.0
*/

import org.WhyMCA.WhyMCANews.R;
import org.WhyMCA.Utils.Global;

import android.util.Log;

public class WhyMCANewsModel {
	
	/**
	 * Titolo post
	 */
	private String title;
		/**title
	 * @param title the title to set
	 */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * @return the cityId
	 */
	public String getTitle() {
		return title;
	}
	
	/**
	 * link al post
	 */
	private String link;

	/**
	 * @param link the link to set
	 */
	public void setLink(String link) {
		this.link = link;
	}

	/**
	 * @return the link
	 */
	public String getLinkName() {
		return link;
	}

	/**
	 * La descrizione del post
	 */
	private String description;
	
	/**
	 * @param description the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * Data pubblicazione
	 */
	private String pubDate;
	
	/**
	 * @param pubDate the pubDate to set
	 */
	public void setPubDate(String pubDate) {
		this.pubDate = pubDate;
	}

	/**
	 * @return the pubDate
	 */
	public String getPubDate() {
		return pubDate;
	}
	
	/**
	 * @return the data_trunk
	 */
	public String getDataTrunk() {
		
		String _date = null;
		
		if(getPubDate().contains("Fri")) { 
		
			_date =  (Global.getCtx().getResources().getString(R.string.ven_str) + getPubDate().substring(3, getPubDate().length() - 5));
						
		} else if(getPubDate().contains("Sat")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.sab_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		} else if(getPubDate().contains("Sun")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.dom_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		} else if(getPubDate().contains("Mon")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.lun_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		} else if(getPubDate().contains("Tue")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.mar_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		} else if(getPubDate().contains("Wed")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.mer_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		} else if(getPubDate().contains("Thu")) { 
			
			_date = (Global.getCtx().getResources().getString(R.string.gio_str) + getPubDate().substring(3, getPubDate().length() - 5));
			
		}
		
		//System.out.println(_date);
		System.out.println(_date);
		return _date;
		
	}
	
}
